#ifndef DOWNLOADITEMLIST_H
#define DOWNLOADITEMLIST_H

#include <QScrollArea>

namespace Jcr
{
class DownloadItem;
class DownloadItemListPrivate;
class DownloadItemList : public QScrollArea
{
    Q_OBJECT
public:
    DownloadItemList(QWidget* parent = nullptr);
    ~DownloadItemList();

    void addItem(Jcr::DownloadItem* item);
    void removeItem(Jcr::DownloadItem* item);
    const QList<Jcr::DownloadItem*> items() const;

    void clear();

    void scrollToEnd();
    void scrollToTop();

protected:
    void showEvent(QShowEvent* e);
    void resizeEvent(QResizeEvent *e);

private:
    DownloadItemListPrivate* d_ptr;
    Q_DISABLE_COPY(DownloadItemList)
};

} // namespace
#endif // DOWNLOADITEMLIST_H
